package cn.yunhe.controller;

import cn.yunhe.model.DemoModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.yunhe.exception.ServiceException;
import cn.yunhe.util.ErrorMessage;


@Controller
@RequestMapping("/demo")
public class DemoController {
	
	@RequestMapping("/test1")
    public ModelAndView getUser(String username){
		DemoModel dm = new DemoModel();
		if (username==null||"".equals(username)) {
			throw new ServiceException(ErrorMessage.ERROR_LOGIN);
		}
		return new ModelAndView("index");
	}	
	
}
